<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="textml; charset=utf-8" />
<title></title>
<style>
#div1 div{
	width:200px;
	height:200px;
	border:1px solid black;
	display: none;
}
.active{
	background:pink;
}
</style>
<script type="text/javascript">
	window.onload=function(){
		var odiv=document.getElementById('div1');
		var oip=odiv.getElementsByTagName('input');
		var adiv=odiv.getElementsByTagName('div');
		for(var i=0;i<oip.length;i++)
		{   oip[i].index=i;
		   oip[i].onclick=function()
			{
			for(var i=0;i<oip.length;i++)
			{
				oip[i].className='';
				adiv[i].style.display='none';
			}

			this.className='active';
			 adiv[this.index].style.display='block ';
		    };
		   
	   }
	};
</script>
</head>
<body>
<div id="div1">
<input class="active" type="button" value="招生"/>
<input type="button" value="出国"/>
<input type="button" value="回家"/>
<input type="button" value="在校"/>
<div style="display: block;">春眠不觉晓</div>
<div>处处闻啼鸟</div>
<div>夜来风雨声</div>
<div>花落知多少</div>
</div>
</body>
</html>
